package com.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 教师课程表
 *
 * @TableName teacher_schedule
 */
@TableName(value = "teacher_schedule")
@Data
public class TeacherSchedule implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 排课ID
     */
    @TableId(value = "schedule_id", type = IdType.AUTO)
    private Long scheduleId;
    /**
     * 教师ID
     */
    @TableField(value = "teacher_id")
    private Long teacherId;
    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;
    /**
     * 课程ID
     */
    @TableField(value = "course_id")
    private Long courseId;
    /**
     * 上课日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date date;
    /**
     * 开始时间
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "start_time")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private Date startTime;
    /**
     * 结束时间
     */
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    @TableField(value = "end_time")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private Date endTime;
    /**
     * 状态(0-可预约 1-已预约 2-已取消 3-已完成)
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * 重复类型(once-单次 daily-每天 weekly-每周)
     */
    @TableField(value = "repeat_type")
    private String repeatType;
    /**
     * 重复结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(value = "repeat_end_date")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date repeatEndDate;
    /**
     * 创建时间
     */
    @TableField(value = "created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;
    /**
     * 更新时间
     */
    @TableField(value = "updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @TableField(exist = false)  // 标记为非数据库字段
    private Boolean replaceAll;
}